<?php
namespace app\wechat\controller;
use app\api\service\Comment;
use app\api\service\Order;
use think\Db;

class WComment extends WCommon
{

    // 评论页面
    public function index() {
        $type = input('param.type');
        $order_id = input('param.order_id');
        $this->assign('type', $type);
        $this->assign('order_id', $order_id);
        return view();
    }

    // 保存评论页面
    public function save_comment() {
        $param = [
            'member_id' => session('member_id'),
            'obj_id' => input('param.obj_id'),
            'type' => input('param.type'),
            'content' => input('param.content'),
            'level' => input('param.level'),
            'label' => input('param.label')
        ];
        $data = call_interface('publish_comment',$param);
        return json($data);
    }

    // 获取评论标签
    public function get_labels() {
        $data = call_interface('get_labels');
        return json($data);
    }
}
